//
//  BCLaunchManager.m
//  BananaChat
//
//  Created by 于洪东 on 2019/11/1.
//  Copyright © 2019 香蕉. All rights reserved.
//

#import "BCLaunchManager.h"
#import "BCBaseTabBarController.h"
#import "DemoCallManager.h"



@interface BCLaunchManager ()

@end


@implementation BCLaunchManager

-(void)determineLaunchDisplayed{
    
    [self showCustomRootVC];
    
#warning 环信
    // appkey替换成自己在环信管理后台注册应用中的appkey
    EMOptions *options = [EMOptions optionsWithAppkey:@"1109191103148894#xiangjiao"];
    // apnsCertName是证书名称，可以先传nil，等后期配置apns推送时在传入证书名称
    options.apnsCertName = nil;
    [[EMClient sharedClient] initializeSDKWithOptions:options];
    
    
    [[EMClient sharedClient] loginWithUsername:@"13121380325" password:@"123456" completion:^(NSString *aUsername, EMError *aError) {
        if (!aError) {
            NSLog(@"登录成功");
        } else {
            NSLog(@"登录失败的原因---%@", aError.errorDescription);
        }
    }];
    
    // 音视频的初始化
    [DemoCallManager sharedManager];
    
    
}



#pragma mark - 启动视图 根视图显示逻辑
-(void)showCustomRootVC{
    BCBaseTabBarController *root = [[BCBaseTabBarController alloc]init];
    [UIApplication sharedApplication].keyWindow.rootViewController = root;
}


@end
